import 'package:ichinesereader/models/common/Achievement.dart';

class MyAchievement {
  MyAchievement({
    this.id,
    this.achievement,
    this.viewed,
    this.when,
    this.current,
  });

  String? id;
  Achievement? achievement;
  bool? viewed;
  int? when;
  int? current;

  factory MyAchievement.fromJson(Map<String, dynamic> json) => MyAchievement(
        id: json["id"],
        achievement: Achievement.fromJson(json["achievement"]),
        viewed: json["viewed"],
        when: json["when"],
        current: json["current"],
      );

  Map<String, dynamic> toJson() => {
        "id": id,
        "achievement": achievement?.toJson(),
        "viewed": viewed,
        "when": when,
        "current": current,
      };
}
